package com.kingmed.kmss.common.exception.api;


import com.kingmed.kmss.common.enums.base.code.IResultCode;

/**
 * 自定义API异常（CRM对外标准接口的异常，内部异常不要用）
 */
public class ApiException extends RuntimeException {
    private IResultCode resultCode;

    public ApiException(IResultCode resultCode) {
        super(resultCode.getMessage());
        this.resultCode = resultCode;
    }

    public ApiException(String message) {
        super(message);
    }

    public ApiException(Throwable cause) {
        super(cause);
    }

    public ApiException(String message, Throwable cause) {
        super(message, cause);
    }

    public IResultCode getErrorCode() {
        return resultCode;
    }
}
